---
title: 消息撤回监听
hide_title: true
sidebar_position: 5
---

<Tabs
groupId="sdks-language"
values={[
{ label: 'Android', value: 'andorid', },
{ label: 'iOS', value: 'ios', },
{ label: 'JavaScript', value: 'js', }
]
}>
<TabItem value="andorid">

</TabItem>
<TabItem value="ios">

</TabItem>
<TabItem value="js">

全局只需设置一次，多次设置会覆盖，其他人给当前用户发送消息会触发消息监听


```js
let { Event } = jetim;

jetim.on(Event.MESSAGE_RECALLED, (notify) => {
  // 此处更新内存中的消息即可，SDK 会自动处理本地及服务端存储的历史消息
  console.log(notify);
});
```

**notify 示例：**
```js
{
  conversationType: 1,
  conversationId: "dDshdk1d4",
  content: {
    // 被撤回的消息的 UID
    messageId: "nq4d9xsfgeghvtnd",
    // 被撤回消息的消息时间
    sentTime: 1712903378965
  },
  sender: {
    id: 'dkdosd',
    name: 'chater',
    portrait: 'https://xxx.example.com/avatar.png'
  }
}
```
</TabItem>
</Tabs>